<?php

namespace App\Http\Controllers\Agency;

use App\Http\Controllers\Controller;
use App\Services\LogService;
use Illuminate\Http\Request;
use hg\apidoc\annotation as Apidoc;

/**
 * 举报管理
 * @Apidoc\Group("examine")
 */
class MemberLogController extends Controller
{
    /**
     * @Apidoc\Title ("客户日志")
     * @Apidoc\Url("/agency/memberLog")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("page",type="int",require=true,desc="页数")
     * @Apidoc\Param("pageSize",type="int",require=true,desc="条数")
     * @Apidoc\Param("mid",type="int",require=false,desc="举报者id")
     * @Apidoc\Param("username",type="string",require=false,desc="举报者昵称")
     * @Apidoc\Param("otherid",type="int",require=false,desc="被举报者id")
     * @Apidoc\Param("othername",type="string",require=false,desc="被举报者昵称")
     * @Apidoc\Param("blacktype",type="string",require=false,desc="举报类型")
     * @Apidoc\Param("flag",type="string",require=false,desc="状态wait：待审核；pass：通过；refuse：未通过")
     * @Apidoc\Returned("id",type="int",require=false,desc="列表id"),
     * @Apidoc\Returned("option_id",type="object",require=false,desc="操作人id"),
     * @Apidoc\Returned("option_user",type="object",require=false,desc="操作人"),
     * @Apidoc\Returned("control",type="string",require=false,desc="操作模块"),
     * @Apidoc\Returned("action",type="int",require=false,desc="操作动作"),
     * @Apidoc\Returned("dowhat",type="string",require=false,desc="日志"),
     * @Apidoc\Returned("created_at",type="string",require=false,desc="时间"),
     **/
    public function memberLog(Request $request , LogService $logService)
    {
        $params = $request->input();
        $params['aid'] = $this->getAid();
        $result = $logService->memberLog($params);
        return $this->responseSuccess($result);
    }

    /**
     * @Apidoc\Title ("客户日志-删除")
     * @Apidoc\Url("/agency/memberLogDel")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("ids",type="int",require=true,desc="列表id 1,2,4")
     * @Apidoc\Param("status",type="string",require=true,desc="wait待审核；pass通过；refuse未通过")
     * @Apidoc\Returned("true",type="bool",desc="保存状态")
     *
     */

    public function memberLogDel(Request $request , LogService $logService)
    {
        $params = $request->input();
        $result = $logService->memberLogDel($params);
        if($result)
            return $this->responseSuccess($result);
        else
            return $this->responseError(400);
    }


}
